|
|
|
|
|
|
|
position. In contrast, to move a drawing that you have drawn directly on a form, you would need to modify the drawing source code. |
|
|
|
|
|
|
|
|
Printer objects represent printers attached to your computer. By drawing to a printer object and then telling the object you are finished, you can print text and graphics. |
|
|
|
|
|
|
|
|
Forms, picture boxes, and printers all provide the graphic methods shown in Table 1.2. |
|
|
|
|
|
|
|
|
Forms and picture boxes also provide a Cls method that clears the drawing area. These methods are described in detail in the following sections. |
|
|
|
|
|
|
|
|
The Line method allows you to draw line segments using the following syntax: |
|
|
|
|
|
|
|
|
Line Step(x1, y1)-Step(x2, y2), color, BF |
|
|
|
|
| |
|
|
|
|
If you include the first Step keyword, the coordinates of the line's starting point are relative to the end of your last drawing command. If you just finished drawing a line that ended at (100, 100), and you now specify x1 = 10 and y1 = 50, this line starts at (110, 150). |
|
|
|
| | |
|
|
|
|
The coordinate of the point at which the line should start. If you omit this point, the line starts where the previous drawing command ended. |
|
|
|
| | |
|
|
|
|
If you include the second Step keyword, the coordinates of the line's ending point are relative to the line's starting point. |
|
|
|
| | |
|
|
|
|
The coordinate of the point at which the line should end. |
|
|
|
| | |
|
|
|
|
The color the line should have. |
|
|
|
| | |
|
|
|
|
If you include the B flag, the Line method draws a box with corners at the start and end points. |
|
|
|
| | |
|
|
|
|
If you include the F flag, the Line command fills the box with corners at the start and end points, using the same color used to draw the box. If you use the F flag, you must also include the B flag. |
|
|
|
|
|
|
|
|
|
|
A common reason to omit the line's starting point is to draw a sequence of connected line segments like this: |
|
|
|
|
| Table 1.2 Graphic Methods for Objects | | METHOD | PURPOSE | | Line | Draws a line, rectangle, or filled box | | Circle | Draws a circle or ellipse, or an arc of a circle or ellipse | | PaintPicture | Copies a picture from one control to another | | PSet | Sets the color of a specified point | | Point | Returns the color of a specified point | | Print | Displays text |
|
|
|